"use strict";
var vue = new Vue({
	el: '#app',
	data: {
		// 头部信息
		headerContent: "",
		// activeIndex: "1",
		// vueHeader对象
		vueHeader: {},
		// 产品信息列表
		productList: [{
			id: 1,
			logo: "img/productionIcon/帖子.png",
			name: "奶盒空间",
			to: "post.html",
			description: "闲着无聊，进来逛逛"
		}, {
			id: 2,
			logo: "img/productionIcon/变量名.png",
			name: "变量名起名器",
			to: "variableNamer.html",
			description: "给我一个中文描述，给你一个英文变量名"
		},
		{
			id: 3,
			logo: "img/productionIcon/公告.png",
			name: "公告详情",
			to: "notice.html",
			description: "这里是详细的公告和开发日志"
		},
		{
			id: 4,
			logo: "img/productionIcon/春节.png",
			name: "2023春晚节目单",
			to: "2023_CCTV_SF.html",
			description: "2023春晚节目单"
		},

		],
		// 公告信息类表
		noticeList: [
			{
				"id": 1,
				"title": "公告加载中",
				"content": "加载中",
				"time": "2000-11-11 11:11:11"
			}
		],
		test: "test"
	},
	//钩子函数，VUE对象初始化完成后自动执行
	created() {
		// axios.get(addressNCGerAll).then((result)=>{
		// 	if (result.data.flag) {
		// 		this.noticeList = result.data.data;
		// 		console.log(result.data.data);
		// 	}
		// });
		getNoticeListFromServer(this);
	},
	methods: {
		handleSave() {
			console.log('表单数据是：', this.formData);
		},
		/**
		 * 跳转到指定下标的页面
		 * @param {number} index 产品类表下标
		 */
		productClick(index) {
			console.log(index);
			location.href = this.productList[index].to;
		},
		/**
		 * 跳转到公告页面
		 */
		toNotice() {
			location.href = "notice.html";
		},
		// 注意，此方法由vueHeader在创建时自动调用，参数为vueHeader自身对象
		// 可以在vueHeader对象中获取到它的所有信息
		vueHeaderCreated(vueHeader) {
			this.vueHeader = vueHeader;
		}
	}
});